<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!--  @Autor: Flávio CANTUÁRIA -->

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.prime.com.tr/ui"
	template="../../layout/template.xhtml">

	<ui:define name="body">
		<p:panel id="panelPessoaCadastro" header="Nova Pessoa">
			<h:form prependId="false">  
	
				<p:messages id = "msg"/>
	
		  		<h:panelGrid id="grid" columns="2" columnClasses="label, value" styleClass="grid" >  
	
	                <h:outputText value="Nome *"/>
	                <p:inputText id = "nome" required="true" label="nome" value="#{pessoa.instance.nome}" 
		                				requiredMessage="Nome é um campo obrigatório"/>
									                
	                
	                <h:outputText value="Endereço" />  
	                <p:inputText id="endereco" required="false" label="endereco" value="#{pessoa.instance.endereco}"/> 
	                
	                <h:outputText value="CPF" />  
            		<p:inputMask id="cpf" required="false" value="#{pessoa.instance.cpf}" mask="999.999.999-99"/> 
	                
	                
				 </h:panelGrid>
				 
			 	 <p:spacer width="0" height="50" />
			  
				 <p:commandButton value="Salvar" update="panelPessoaCadastro"   
	                       actionListener="#{pessoa.salvar}" />
	            
		                       
			</h:form>  
		</p:panel>
	</ui:define>
</ui:composition>
